#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>

int main() {
    struct stat buf;
    int fd = open ("test.txt", O_RDONLY);
    fstat(fd, &buf);
    printf("file size = %ld\n", buf.st_size);  //输出23
    printf("上次更新时间 = %ld\n", buf.st_mtime);
    printf("已分配的 512B 的块的个数 = %ld\n", buf.st_blocks);  
    //8???8*512B = 4KB(为一个page的大小)
    
}
